const {mysql} = require('../qcloud')
module.exports = async (ctx) => {
    const {id} = ctx.request.query
    await mysql('books').where('id',id).increment('count',1)
    try {
        ctx.state = {
            code: '00',
            data: {
                mag: '操作成功'
            }
        }
    } catch (e) {
        ctx.state = {
            code: '02',
            data: {
                mag: '服务器爸爸已经崩溃'
            }
        }
    }
    
}